/*
编写程序读入输入，读到#停止，报告ei出现的次数。注意：该程序要记录前一个字符和当前字符。用"Receive your eieio award"这样的输入来测试。
 * */
#include<stdio.h>
int main()
{
    int count = 0;
    int flag = 0;
    char ch;
    while ((ch = getchar()) != '#')
    {
        if (ch == 'e' && flag == 0)
	{
	    flag = 1;
	}
	if (ch == 'i' && flag == 1)
	{
	    flag = 0;
	    count++;
	}
    }
    printf("the count of  ei occured is %d\n",count);
    return 0;
}
